package com.example.tired1.widgettest_0131shiyining;

import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
import android.view.View;
import android.widget.Button;
import android.widget.CheckBox;
import android.widget.EditText;
import android.widget.ImageButton;
import android.widget.ImageView;
import android.widget.RadioButton;
import android.widget.TextView;
import android.widget.Toast;

public class MainActivity extends AppCompatActivity implements View.OnClickListener{
    Button button;
    EditText editText;
    TextView textView;
    ImageButton imageButton;
    ImageView imageView;
    RadioButton radioButton;
    CheckBox checkBox;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main);
        button=(Button)findViewById(R.id.button);
        button=(Button)findViewById(R.id.button2);
        button=(Button)findViewById(R.id.button3);
        button=(Button)findViewById(R.id.button4);
        editText=(EditText)findViewById(R.id.editText);
        textView=(TextView)findViewById(R.id.textView);
        imageButton=(ImageButton)findViewById(R.id.imageButton);
        imageView=(ImageView)findViewById(R.id.imageView);
        radioButton=(RadioButton)findViewById(R.id.radioButton_f);
        radioButton=(RadioButton)findViewById(R.id.radioButton_m);
        checkBox=(CheckBox)findViewById(R.id.checkBox10);
        checkBox=(CheckBox)findViewById(R.id.checkBox11);
        checkBox=(CheckBox)findViewById(R.id.checkBox12);

        button.setOnClickListener(this);
    }

    @Override
    public void onClick(View v) {
        String text=editText.getText().toString();
        textView.setText(text);
        Toast.makeText(MainActivity.this,"button is clicked",Toast.LENGTH_SHORT).show();

    }
}
